#!/usr/bin/python
import os,sys

def kario(k):
	primerNivel = [0]
	segundoNivel = range(1,k+1)
	tercerNivel = range(k+1,3*k+1)
	ultimoNivel = range(3*k+1,5*k+1)
	
	aristas = 5*k
	nodos = 5*k+1

	print "%d %d" % (nodos,aristas)
	for i in segundoNivel:
		print "%d %d" % (0,i)
	for i in range(0,len(segundoNivel)):
		print "%d %d" % (segundoNivel[i],tercerNivel[2*i])
		print "%d %d" % (segundoNivel[i],tercerNivel[2*i+1])
	for i in range(0,len(tercerNivel)):
		print "%d %d" % (tercerNivel[i],ultimoNivel[i])
	
def main():
	st = int(sys.argv[1])	
	end = int(sys.argv[2])
	gap = int(sys.argv[3])
	for i in range(st,end,gap):
		kario(i)

if __name__ == "__main__":
	main()
